<html>
<head><meta charset="utf-8"><title>Decreased performance and lots of logging visible in VsCode · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html">Decreased performance and lots of logging visible in VsCode</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197175037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175037">(May 11 2020 at 17:01)</a>:</h4>
<p>Hi everyone!<br>
Since the last 2 weeks or so RA performance degraded for me so bad that it's unusable at the moment (100% CPU load for multiple minutes, repeats as I click/hover anything). I'm not yet sure if the degradation came through a recent update, or due me opening a different workspace.</p>
<p>What I've seen so far is however that there is a lot of debug output visible in the VsCode -&gt; Output -&gt; "Rust Analyzer Language Server" tab. I'm wondering if that all should be there, or whether it was accidentally enabled through some way. Excessive logging could obviously degrade performance.</p>
<p>Some examples:</p>
<div class="codehilite"><pre><span></span><code>[DEBUG salsa::derived::slot] maybe_changed_since(AstIdMapQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13902)) }))): false since (recomputed) value changed at R17080
[DEBUG salsa::derived::slot] maybe_changed_since(ParseMacroQuery(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13902)) })) called with revision=R17080, revision_now=R17084
[DEBUG salsa::derived::slot] maybe_changed_since(ParseMacroQuery(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13902)) }): false since up-to-date memo that changed at R17080
[INFO  salsa::derived::slot] RawItemsQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13902)) }))): validated old memoized value
[DEBUG salsa::runtime] is_current_revision_canceled: current_revision=R17084, pending_revision=R17084
[DEBUG salsa::derived::slot] maybe_changed_since(RawItemsQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13902)) }))): false since (recomputed) value changed at R17080
[DEBUG salsa::derived::slot] maybe_changed_since(RawItemsQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13903)) })))) called with revision=R17080, revision_now=R17084
[DEBUG salsa::derived::slot] check_durability(last_changed=R17084 &lt;= verified_at=R17080) = false
[DEBUG salsa::derived::slot] RawItemsQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13903)) }))): read_upgrade(revision_now=R17084)
[DEBUG salsa::derived::slot] RawItemsQuery(HirFileId(MacroFile(MacroFile { macro_call_id: LazyMacro(LazyMacroId(13903)) }))): found memoized value, verified_at=R17080, changed_at=R17080
[DEBUG salsa::derived::slot] validate_memoized_value(RawItemsQuery): verified_at=Tracked {
</code></pre></div>


<p>Is the debug logging level somehow set through my system (I can't find anything in RA settings) or part of the downloaded package?</p>



<a name="197175162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175162">(May 11 2020 at 17:02)</a>:</h4>
<p>I think you have <code>RUST_LOG</code> env variable set?</p>



<a name="197175176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175176">(May 11 2020 at 17:03)</a>:</h4>
<p>Do you have the <code>RUST_LOG</code> env var set? edit: <span class="user-mention" data-user-id="133169">@matklad</span> is <strong>fast</strong> <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="197175189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175189">(May 11 2020 at 17:03)</a>:</h4>
<p>we use stock env_logger for logging</p>



<a name="197175652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175652">(May 11 2020 at 17:06)</a>:</h4>
<p>Just between sending that and looking at the thread again I checked the same. It was indeed set within the VsCode console :O</p>



<a name="197175744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175744">(May 11 2020 at 17:07)</a>:</h4>
<p>It seemed like I started VsCode on a terminal which had <code>export RUST_LOG=debug</code> set because I did some CLI testing with an app before</p>



<a name="197175787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175787">(May 11 2020 at 17:07)</a>:</h4>
<p>We might show an info message if <code>RUST_LOG=debug</code> is enabled...</p>



<a name="197175915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197175915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197175915">(May 11 2020 at 17:08)</a>:</h4>
<p>Closing Code, and starting it on a new terminal without env variable fixed the perf issue <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="197176129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197176129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197176129">(May 11 2020 at 17:10)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> Might it be worth it not to use the <code>RUST_LOG</code> variable from the environment variable but instead just from a RA setting?</p>



<a name="197176148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197176148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197176148">(May 11 2020 at 17:10)</a>:</h4>
<p>That could avoid that kind of "surprise"</p>



<a name="197176265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197176265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197176265">(May 11 2020 at 17:11)</a>:</h4>
<p>I probably had the same terminal open with the debug variable set for weeks, since I'm reusing the terminal to open the workspace <span aria-label="rolling eyes" class="emoji emoji-1f644" role="img" title="rolling eyes">:rolling_eyes:</span></p>



<a name="197176836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197176836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197176836">(May 11 2020 at 17:16)</a>:</h4>
<p><span class="user-mention" data-user-id="204219">@Matthias247</span> good suggestion, impled in <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4424">https://github.com/rust-analyzer/rust-analyzer/pull/4424</a></p>



<a name="197178076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Decreased%20performance%20and%20lots%20of%20logging%20visible%20in%20VsCode/near/197178076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Decreased.20performance.20and.20lots.20of.20logging.20visible.20in.20VsCode.html#197178076">(May 11 2020 at 17:26)</a>:</h4>
<p>Awesome! Thanks for taking it into account</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>